import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import Router from '@/router/index.ts'

import { createPinia } from 'pinia'
import piniaPluginPersistedState from 'pinia-plugin-persistedstate'
// 状态管理
const pinia = createPinia()
pinia.use(piniaPluginPersistedState)

// 导入store对象
import store from './store'

// 引入element-plus组件库
import ElementPlus from 'element-plus' //全局引入
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' // 中文

// 引入ant-design组件库
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'

// 引入外部图标
import './assets/iconfont/iconfont.css'

// 导入全局样式表
import './assets/css/global.css'

// Storage存储封装
import storage from './utils/storage'

// 导入接口代码
import request from './api'

// 导入树形控件
//vxe-table
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'

const app = createApp(App)
app.use(Router)
app.use(pinia)
app.use(store)
app.use(ElementPlus, {
  locale: zhCn
})
app.use(Antd)
app.config.globalProperties.$storage = storage
app.config.globalProperties.$request = request
app.use(VXETable)
app.mount('#app')
